<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        // 1、先定义一个临时变量
        // 2、把apple1给临时变量
        // 3、然后把apple2 给apple1 
        // 4、最后把临时变量给apple2
        var temp,
            apple1 = '红苹果',
            apple2 = '绿苹果';
        temp = apple1;
        apple1 = apple2;
        apple2 = temp;
        console.log(apple1);
        console.log(apple2);
    </script>
</head>

<body>

</body>

</html>